package com.ljq;

public class Person extends Creature{
    String id;
    String name;
    int hp;
    int CE;
    private  Room currentRoom;
    String description;

    @Override
    public void useArticle(Article article, Creature targetCreature) {
        article.useArticle(targetCreature);
//        System.out.print("攻击值:"+article.CE);
//        creature.hp -= article.CE;
//        System.out.print("剩余生命值："+creature.hp);
    }

    @Override
    public void setCurrentRoom() {

    }

    public void go(String targetRoomId){
        Room room;
        room= currentRoom.searchReachableRoomById(targetRoomId,currentRoom.getReachableRooms());
        if (room != null) {
            //2.如果找到房间，将该Room赋给Person.currentRoom
            this.currentRoom=room;
            //显示人所在的当前房间可到达的房间
            Ui.displayReachableRooms(this);
        } else {
            //如果没有找到房间，显示没有目标房间
            Ui.printNoRoom();
        }
    }

    public Person() {
    }

//    public void Person1(){
//        this.name="小白";
//        this.id = "20190001";
//        this.hp = 120;
//        this.CE = 40;
//    }
    public Person(String id, String name, int hp, int CE, String description) {
        this.id = id;
        this.name = name;
        this.hp = hp;
        this.CE = CE;
        this.description = description;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getCE() {
        return CE;
    }

    public void setCE(int CE) {
        this.CE = CE;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Room getCurrentRoom() {
        return currentRoom;
    }

    public Room getCurrentRoom(Room room) {
        this.currentRoom = room;
        return currentRoom;
    }
    public void setCurrentRoom(Room currentRoom) {
        this.currentRoom = currentRoom;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
